package com.liandu.controller;


import com.liandu.common.JResponse;
import com.liandu.common.parent.ParentController;
import com.liandu.entity.CalInfo;
import com.liandu.entity.WeighInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@Api("基础服务层")
@RestController
@RequestMapping("/market")
public class ServerController extends ParentController {

    @ApiOperation("1 电子秤基础信息")
    @GetMapping("/ecrInfo")
    public JResponse getAllEcrInfo(){
        return JResponse.successful(ldService.getAllEcrInfo());
    }

    @ApiOperation("2 秤标定信息查询")
    @GetMapping("/calInfo")
    public JResponse getAllCallInfo(CalInfo calInfo, @ApiParam(value = "格式为yyyy-MM-dd HH:mm:ss的字符串") String start, String end, String busiName){
        return JResponse.successful(ldService.getAllCalInfo(calInfo,start,end,busiName));
    }

    @ApiOperation("3 获取所有的交易信息")
    @GetMapping("/weight")
    public JResponse getAllWeight(WeighInfo weighInfo,@ApiParam(value = "格式为yyyy-MM-dd HH:mm:ss的字符串") String start,String end,String busiName){
        return JResponse.successful(ldService.getAllWeight(weighInfo,start,end,busiName));
    }







    @ApiOperation("测试1")
    @GetMapping("/market")
    public JResponse getAllMarKet(){
        return JResponse.successful(ldService.getAllMarKet());
    }
    @ApiOperation("测试2")
    @GetMapping("/busiInfo")
    public JResponse getAllBusiInfo(){
        return JResponse.successful(ldService.getAllBusiInfo());
    }

}
